UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IxPzIpASwyuwZXh6xY0ituqaqVCsUfMKV1nAx1l1YXQ='
WHERE
key_id = 'e0a0465020d3662ef7f58d30314d7906444181bdcb58f739465ee7ae7617d3d2'
AND (
token = 'IxPzIpASwyuwZXh6xY0ituqaqVCsUfMKV1nAx1l1YXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)