UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WJaJXacVuTQHPi2/Z5Aqf9KPsQUGuK0fU1E9wLe18Wo='
WHERE
key_id = 'c73727acfb42608e80f1ad72d5e18b2acff69708596d0b384c5de44237822f2f'
AND (
token = 'WJaJXacVuTQHPi2/Z5Aqf9KPsQUGuK0fU1E9wLe18Wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)