UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CFRXT9CZS9v5svImH5Y9Twq9QbdyAJgSLDK4Fut9DBM=' 
WHERE 
  key_id = '426c3c7188ad5854f6d8357fc25cc52e3cc3ccc9629f43889d6e3b2a15e83a5d' 
  AND (
    token = 'CFRXT9CZS9v5svImH5Y9Twq9QbdyAJgSLDK4Fut9DBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040