UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WpojlwGlQqj62VEM5DytmhITvegQKZ0x/YCwigMi7Oc=' 
WHERE 
  key_id = 'ae3b7ed0f660a6e5d608009899129dc886d93342b480d2bf18d93e2944478af0' 
  AND (
    token = 'WpojlwGlQqj62VEM5DytmhITvegQKZ0x/YCwigMi7Oc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035