UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EQ+yq3rEJctZW++SNq7Y85sdzTebv+y9q9X8haueokc=' 
WHERE 
  key_id = 'c099497ba47062fa4b46314647e9236e300a12c424fec8b17f08ce23235f4ee8' 
  AND (
    token = 'EQ+yq3rEJctZW++SNq7Y85sdzTebv+y9q9X8haueokc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056