UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sSeqY4YFGj8QuMrvcM8PiJQT8h3Y+liiymXNC91bkzE='
WHERE
key_id = 'fdf55631bd20fb1447cc5604f362204dd69a51664d50aa7e2a11a85cff2dad9d'
AND (
token = 'sSeqY4YFGj8QuMrvcM8PiJQT8h3Y+liiymXNC91bkzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)