UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8+O3NbnQ8rel+r6INeVelILnptC0yyG4scaXhswt93M=' 
WHERE 
  key_id = '48fec6b2f9fd1832e81ab125084f23aaf30c9bda4db57e4ef295732e7153cb98' 
  AND (
    token = '8+O3NbnQ8rel+r6INeVelILnptC0yyG4scaXhswt93M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042