UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ePcNA/1cifgm1PTSW0Ai9MNqy5yhG0pXJ7ramVUwEgw=' 
WHERE 
  key_id = '86130c4a315fa366feb7ebfc8041b099797ff4682fc955485e849f3c62a68dce' 
  AND (
    token = 'ePcNA/1cifgm1PTSW0Ai9MNqy5yhG0pXJ7ramVUwEgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031