UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Jro7tUV4EeJdfoFDgzpb3p6tajnK5s+//Vpu8Rzq8A='
WHERE
key_id = '586b91ca9496cfb3b4f919551ebf0d4edccb614a5cb0137dc24705a8a87f2b47'
AND (
token = '4Jro7tUV4EeJdfoFDgzpb3p6tajnK5s+//Vpu8Rzq8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)