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