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