UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EH6QwNw74uAoKcLJzMVD4wJcjr0hMogOsb5CL1lKrdo='
WHERE
key_id = '88705ec8f1f9760bc79f3f14f3009d265a82df5ba244cf8f04d6a4163f25e70f'
AND (
token = 'EH6QwNw74uAoKcLJzMVD4wJcjr0hMogOsb5CL1lKrdo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)