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

Query time 0.00042