UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CRFqlSHlO8LXq0RGpbWGROqLNnXwmmLlb6JzhEdZVv4='
WHERE
key_id = '2ac502c5904b9f05d8149a51a9162e5fa29a80f46fa7bb8fe06ef97a0e2ea2af'
AND (
token = 'CRFqlSHlO8LXq0RGpbWGROqLNnXwmmLlb6JzhEdZVv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)