UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aSvtU/QSQe3VKzl13wJuLNh0j7svasbLRaGPtJdLVW8='
WHERE
key_id = '39bc993917e9bfa07c7711a7930ca0b8f4f129f1c0cee8bfef0770d4beffe9d9'
AND (
token = 'aSvtU/QSQe3VKzl13wJuLNh0j7svasbLRaGPtJdLVW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)