UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JzXuNVON0yjcLX4pWqSUmbCmPdohh4nG7IkHfTkIhFs=' 
WHERE 
  key_id = '4192b7542ab3e4e140b86a552c3ebf7b984c94bad2b502aea2eb1558ffeb061b' 
  AND (
    token = 'JzXuNVON0yjcLX4pWqSUmbCmPdohh4nG7IkHfTkIhFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034