UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JYeHiHxmqF1Uh8lTEzyhvF5jEmKVx+Ulm9/EDK3F6vc='
WHERE
key_id = '57ed71c6980a096f66eeee28fea37e13982d0901526ecaa689fa8f13584b26b5'
AND (
token = 'JYeHiHxmqF1Uh8lTEzyhvF5jEmKVx+Ulm9/EDK3F6vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)