UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vUrVVLyYZtZpEndnUvhmXxTGQakmFSNXcT0bUBTrLWo='
WHERE
key_id = '14c9a773f484577d42664b6db64deb2a385aa5b254ad308c58182e7f37efdde8'
AND (
token = 'vUrVVLyYZtZpEndnUvhmXxTGQakmFSNXcT0bUBTrLWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)