UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XrFTGaXUygMXR1AgIeHrd9hh31hV4POWUOdCW8LgzNI='
WHERE
key_id = '994a66af11967cb94e0f9498dc6ef3348ad87b673f2d6bd938d8b5dc73bf925a'
AND (
token = 'XrFTGaXUygMXR1AgIeHrd9hh31hV4POWUOdCW8LgzNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)