UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tt2CEa6HftrsNr9z9e3fsW8AYUB9etVsluYJJ1X7gpA='
WHERE
key_id = 'db5a124386c51fd49e1701bc9f6f42ec968f7cefcc4da0cd64960dab89fd1e18'
AND (
token = 'Tt2CEa6HftrsNr9z9e3fsW8AYUB9etVsluYJJ1X7gpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)