UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7hJBcdwiiR7U7L85f1CpyyumWYxJaWBtKrTn2MgvFYE=' 
WHERE 
  key_id = '993d27e799821331732aac1a5a4e23b437c11f444192b040ab3adb2c2c63e5f0' 
  AND (
    token = '7hJBcdwiiR7U7L85f1CpyyumWYxJaWBtKrTn2MgvFYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038