UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OFlUHK0xbXIKhblqRNxdEiG5zDg8WYdivbHpTIhwB+w='
WHERE
key_id = '675f7521c58d5e19788b24be0fe23e5e09f1d48e286917408006c833dd8c5d28'
AND (
token = 'OFlUHK0xbXIKhblqRNxdEiG5zDg8WYdivbHpTIhwB+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)