UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iRz4L9wR8oN6w61ib58GVAUKlTJt3DgGlkOR5ByAhqE=' 
WHERE 
  key_id = '61511fafcd6e1b326e7abe0adf68fb77ed7c6b99dcfe5de310e0ec45763381bf' 
  AND (
    token = 'iRz4L9wR8oN6w61ib58GVAUKlTJt3DgGlkOR5ByAhqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057