UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q7Mo1hBViJ+EggyvFR+0WyeeEeoZIB3urVrlc51gfNQ=' 
WHERE 
  key_id = 'c542886804a93360470b5a3ff1a365c304bc951fc36f454d6fbbfeb61a9ff96f' 
  AND (
    token = 'q7Mo1hBViJ+EggyvFR+0WyeeEeoZIB3urVrlc51gfNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027