UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1w1l6xWF/3bCxnpK7k1HqoH5ochko4pFwsd4jU7+qQw='
WHERE
key_id = 'cf255ee9c4dbeaf9a340f60f78bb090405bc758475df09c56cf030faaf97fd39'
AND (
token = '1w1l6xWF/3bCxnpK7k1HqoH5ochko4pFwsd4jU7+qQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)