UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aGDhaifAPLBdM5bzYPo3QPbQsdPv9Q/4EsZx1OXm91Y='
WHERE
key_id = '11fa4fda10bcc17b8bdbc8134251b3feb991277ac0acbd3c407347665c153770'
AND (
token = 'aGDhaifAPLBdM5bzYPo3QPbQsdPv9Q/4EsZx1OXm91Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)