UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYQfJRCID7/XqYqbhe4GnXcSxKE4+zcafXIom47nD2w='
WHERE
key_id = '294c506d44fadec050e6c33fbf83829d6721bec7ce8fcefe01192430d56be76a'
AND (
token = 'oYQfJRCID7/XqYqbhe4GnXcSxKE4+zcafXIom47nD2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)