UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/yiT9GnYQlI3/n0Q9Xiw+dKV3bvRVJtqQxeu6vjC1pw='
WHERE
key_id = '92ec72a2b16f345340ef4f6ef2b87e85d268ede7732fb32a8cd3de029007aa5a'
AND (
token = '/yiT9GnYQlI3/n0Q9Xiw+dKV3bvRVJtqQxeu6vjC1pw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)