UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HEYrzhdOkljJ7bM2YcWwpIqKK1gA8W2NZ0lYKUVEYFQ='
WHERE
key_id = '66e2a082c089e3fcaf6a3f9d86daef1e1b40d5f420899f87cb4600abdb5edb4d'
AND (
token = 'HEYrzhdOkljJ7bM2YcWwpIqKK1gA8W2NZ0lYKUVEYFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)