UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OehRLPzhvdnfUZGjqhZHklBlxJGjOJXM25cAKbDKPKk=' 
WHERE 
  key_id = '90c6cbfbc0b0c2bebd949fa315b6e4b8462f30e3be8f9d9bc6688545767cc1c5' 
  AND (
    token = 'OehRLPzhvdnfUZGjqhZHklBlxJGjOJXM25cAKbDKPKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061