UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3nF593v3TYcjfwmPe4cPEKBZjW20Ez9a+gb5qHJWl8w=' 
WHERE 
  key_id = '52a8db5801e8d2dc73acd00ff462c1641c986c1dcd125fecaf76a8b7310dd962' 
  AND (
    token = '3nF593v3TYcjfwmPe4cPEKBZjW20Ez9a+gb5qHJWl8w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053