UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hq3csOVp702pF0th9iozpRNN0RyRsV8CHMY5u6lBUjA='
WHERE
key_id = '5753c8a53b3e04a5fa94f6a6f3f6a97d5ef58cb35727c8fec84b6aa352e91af7'
AND (
token = 'Hq3csOVp702pF0th9iozpRNN0RyRsV8CHMY5u6lBUjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)